<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="follow, index" />
<meta name="author" content="iune co." />
<meta name="description"
	content="IUNE有最好的库存管理SaaS软件。以更快更高的准确度，跟进实时数据的访问和库存移动。" />
<meta name="keywords"
	content="库存, 存货管理, 库存管理, 仓库管理, 云ERP, 云逸ERP, 中小型企业云ERP, SaaS ERP软件/系统" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>

<style type="text/css">
</style>

</head>
<body>


	<div class="container-fluid" data-ng-controller="saleOrderSingleCtrl as Model">
		<div class="row">
			<div class="col-sm-12">


				<!-- Nav tabs -->
<!--  				
  <ul class="nav nav-tabs" role="tablist">
    <li role="presentation" class="active"><a href="#sale_saleOrder_single_tab_list" role="tab" data-toggle="tab">列表</a></li>
    <li role="presentation"><a href="#sale_saleOrder_single_tab_single" role="tab" data-toggle="tab">详细</a></li>
  </ul>
 -->  

				<!-- Tab panes -->
				<div class="tab-content">
					<!--  列表页面 -->
					<div role="tabpanel" data-ng-class="{true:'tab-pane active',false:'tab-pane'}[tabpanel=='list']" id="sale_saleOrder_single_tab_list">

						<!-- 列表按钮菜单 -->
						<div class="row">
							<div class="col-sm-12">

								<nav class="nav">
									<ul class="pagination navbar-left buttonBar">
										<li>
											<button class="btn btn-success"
												data-ng-click="tabpanel='single';">
												<span class="glyphicon glyphicon-file"></span> 详细
											</button>
										</li>
										<li>
											<div class="btn-group" role="toolbar">
												<shiro:hasPermission name="${path}:create">
													<button type="button" class="btn btn-info "
														data-ng-click="Model.add()">
														<span class="glyphicon glyphicon-plus"></span> 新建
													</button>
												</shiro:hasPermission>

												<shiro:hasPermission name="${path}:save">
													<button type="button" class="btn btn-default"
														data-ng-disabled="Model.dataMaster.currentIndex==null || Model.dataMaster.getCurrentState()"
														data-ng-click="Model.edit()">
														<span class="glyphicon glyphicon-edit"></span> 修改
													</button>
												</shiro:hasPermission>
												<shiro:hasPermission name="${path}:delete">
													<button type="button" class="btn btn-default"
														data-ng-disabled="Model.dataMaster.currentIndex==null || Model.dataMaster.getCurrentState()"
														data-ng-click="Model.remove()">
														<span class="glyphicon glyphicon-trash"></span> 删除
													</button>
												</shiro:hasPermission>
												<shiro:hasPermission name="${path}:query">
													<button type="button" class="btn btn-default" ng-hide="true"
														data-ng-click="Model.refresh()">
														<span class="glyphicon glyphicon-search"></span> 查询
													</button>
												</shiro:hasPermission>
												<shiro:hasPermission name="${path}:export">
													<button type="button" class="btn btn-default"
														data-ng-disabled="Model.dataMaster.currentIndex==null"
														data-ng-click="Model.printExport()">
														<span class="glyphicon glyphicon-export"></span> 输出
													</button>
												</shiro:hasPermission>
											</div>
										</li>
									</ul>

									<shiro:hasPermission name="${path}:query">
										<query-like data="Model.dataMaster" place-holder="模糊查询..."></query-like>
									</shiro:hasPermission>
				
	<form class="navbar-form navbar-left buttonBar" style="padding-right:0px;">
         <div class="form-group">
 			<label class="control-label">单据日期:</label>
          	<range-filter  placeholder="请输入日期" filter-data="Model.dataMaster" filter-relation="SaleOrder.orderDate" xid="rangeilter1" auto-refresh="false"></range-filter>
         </div>
		<shiro:hasPermission name="${path}:query">
		<!-- Split button -->
		<div class="btn-group">
			<button type="button" class="btn btn-default" data-ng-click="Model.refresh()">
				<span class="glyphicon glyphicon-refresh"></span> 刷新
			</button>
		  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
		    <span class="caret"></span>
		    <span class="sr-only">Toggle Dropdown</span>
		  </button>
		  <ul class="dropdown-menu" role="menu">
		    <li><a data-toggle="collapse" href="#_sale_saleOrder_single"> 更多过滤条件</a></li>
		  </ul>
		</div>
		</shiro:hasPermission>
    </form>		

								</nav>
<div class="collapse" id="_sale_saleOrder_single">
  <div class="well" style="padding-left:0px;padding-right:0px;">
	<nav class="nav">
		<form class="navbar-form navbar-left buttonBar" style="padding-left:0px;padding-right:0px;">
         <div class="form-group">
 			<label class="control-label">单号:</label>
          	<grid-filter  placeholder="请输入单号" filter-data="Model.dataMaster" filter-relation="orderNo" xid="gridFilter1" auto-refresh="false"></grid-filter>
         </div>
         <div class="form-group">
 			<label class="control-label">交易对象:</label>
          	<grid-filter  placeholder="请输入对象编码" filter-data="Model.dataMaster" filter-relation="customerNo" xid="gridFilter4" auto-refresh="false"></grid-filter>
         </div>
         <div class="form-group">
 			<label class="control-label">对象名称:</label>
          	<grid-filter  placeholder="请输入对象名称" filter-data="Model.dataMaster" filter-relation="customerName" xid="gridFilter5" auto-refresh="false"></grid-filter>
         </div>
		<button type="button" class="btn btn-default" data-ng-click="Model.refresh()" data-toggle="collapse" data-target="#_sale_saleOrder_single">
			<span class="glyphicon glyphicon-refresh"></span> 刷新
		</button>
		</form>
	</nav>
  </div>
</div>				

							</div>
						</div>
						
						
						<!-- 列表 -->
						<div class="row">
							<div class="col-sm-12">

							<div class="table-responsive">
								<table class="table table-hover table-condensed" style="margin:0px;">
									<thead>
										<tr>
											<th colspan="99"  style="padding:0px;">
											</th>
										</tr>

										<tr>
											<th></th>
											<th>#</th>
											<th hidden="hidden">状态</th>
											<th hidden="hidden">fID</th>
											<th>状态</th>
											<th hidden="hidden">子系统</th>
											<th hidden="hidden">单据类型</th>
											<th>来源类型</th>
											<th>单号</th>
											<th>日期</th>
											<th>客户简称</th>
											<th>工厂</th>
											<th>名称</th>
											<th hidden="hidden">操作状态</th>
											<th>商品金额</th>
											<th>定金比例</th>
											<th>支付状态</th>
											<th>需要物流</th>
											<th>备注</th>
											<th hidden="hidden">创建者编码</th>
											<th hidden="hidden">创建者</th>
											<th hidden="hidden">创建时间</th>
											<th hidden="hidden">创建者id</th>
											<th hidden="hidden">公司id</th>
											<th hidden="hidden">公司</th>
											<th></th>
										</tr>
									</thead>
									<tbody>
										<tr data-ng-show="row.userdata.recordState!='delete'"
											data-ng-class="{true:'active'}[Model.dataMaster.currentIndex==Model.dataMaster.rows.indexOf(row)]"
											data-ng-click="Model.dataMaster.onRowClick(row,$event)"
											data-ng-dblclick="Model.gridListRowDblclick(Model.dataMaster.rows.indexOf(row),$event)"
											data-ng-repeat="row in Model.dataMaster.rows">
											<td style="width: 10px;"><span
												data-ng-show="Model.dataMaster.currentIndex==Model.dataMaster.rows.indexOf(row)"
												class="glyphicon glyphicon-hand-right" aria-hidden="true"></span></td>
											<td style="width: 10px;">{{Model.dataMaster.rows.indexOf(row)+1}}</td>
											<td style="width: 10px;" hidden="hidden"
												data-ng-bind="row.userdata.recordState"></td>
											<td style="width: 200px;" hidden="hidden">{{row.fid.value}}</td>
											<td style="width: 100px;">{{row.resultStatus.value}}</td>
											<td style="width: 100px;" hidden="hidden">{{row.systemCode.value}}</td>
											<td style="width: 100px;" hidden="hidden">{{row.billType.value}}</td>
											<td style="width: 100px;">{{row.orderTypeLabel.value}}</td>
											<td style="width: 100px;">{{row.orderNo.value}}</td>
											<td style="width: 100px;">{{row.orderDate.value}}</td>
											<td style="width: 100px;">{{row.shortName.value}}</td>
											<td style="width: 100px;">{{row.factoryNo.value}}</td>
											<td style="width: 100px;">{{row.factoryName.value}}</td>
											<td style="width: 100px;" hidden="true">{{row.state.value}}</td>
											<td style="width: 100px;">{{row.orderAmountTotal.value}}</td>
											<td style="width: 100px;">{{row.depositRate.value | PercentValue}}</td>
											<td style="width: 100px;">{{row.paymentStatusLabel.value}}</td>
											<td style="width: 100px;" align="center"><input type="checkbox" ng-model="row.isNeedLogistics.value" ng-true-value=1 ng-false-value=0 ng-disabled="true" /></td>
											<td style="width: 100px;">{{row.comments.value}}</td>
											<td style="width: 100px;" hidden="hidden">{{row.cUsercode.value}}</td>
											<td style="width: 100px;" hidden="hidden">{{row.cUsername.value}}</td>
											<td style="width: 200px;" hidden="hidden">{{row.cDatetime.value}}</td>
											<td style="width: 100px;" hidden="hidden">{{row.userId.value}}</td>
											<td style="width: 100px;" hidden="hidden">{{row.enterpriseNo.value}}</td>
											<td style="width: 200px;" hidden="hidden">{{row.enterpriseName.value}}</td>

											<td></td>
										</tr>

									</tbody>

									<tfoot>
										<tr>
											<th colspan="99"  style="padding:0px;">
											</th>
										</tr>
									</tfoot>

								</table>
								</div>
								
							</div>
						</div>
						
						<!-- 分页组件 -->
						<div class="row">
							<div class="col-sm-12">
							
									<pag-ination data="Model.dataMaster" first-text="首页" previous-text="上一页" next-text="下一页" last-text="末页"></pag-ination>

							</div>
						</div>


					</div>
					<!--  列表页面 -->



					<!-- 详细页面 -->
					<div role="tabpanel" data-ng-class="{true:'tab-pane active',false:'tab-pane'}[tabpanel=='single']" id="sale_saleOrder_single_tab_single">


						<!-- 主表按钮菜单 -->
						<div class="row">
							<div class="col-sm-12">
								<nav class="nav">
									<ul class="pagination navbar-left buttonBar">
										<li ng-hide="type=='FLOW'">
											<button class="btn btn-success"
												data-ng-disabled="!Model.dataMaster.readonly()"
												data-ng-click="tabpanel='list';">
												<span class="glyphicon glyphicon-list"></span> 列表
											</button>
										</li>
										<li>
											<div class="btn-group" role="toolbar">
												<shiro:hasPermission name="${path}:create">
													<button type="button" class="btn btn-info "
													 	ng-hide="type=='FLOW'"
														data-ng-disabled="!Model.dataMaster.readonly()"
														data-ng-click="Model.add();">
														<span class="glyphicon glyphicon-plus"></span> 新建
													</button>
												</shiro:hasPermission>
												<shiro:hasPermission name="${path}:save">
													<button type="button" class="btn btn-default"
														data-ng-disabled="Model.dataMaster.currentIndex==null || Model.dataMaster.getCurrentState()"
														data-ng-show="Model.dataMaster.readonly()"
														data-ng-click="Model.edit();">
														<span class="glyphicon glyphicon-edit"></span> 修改
													</button>
												</shiro:hasPermission>

												<button type="button" class="btn btn-success "
													data-ng-show="!Model.dataMaster.readonly()"
													data-ng-click="Model.save();">
													<span class="glyphicon glyphicon-floppy-save"></span> 保存
												</button>
												<button type="button" class="btn btn-warning "
													data-ng-show="!Model.dataMaster.readonly()"
													data-ng-click="Model.saveCancel();">
													<span class="glyphicon glyphicon-floppy-open"></span> 取消
												</button>
												<shiro:hasPermission name="${path}:delete">
													<button type="button" class="btn btn-default"
														data-ng-show="Model.dataMaster.readonly()"
														data-ng-disabled="Model.dataMaster.currentIndex==null || Model.dataMaster.getCurrentState()"
														data-ng-click="Model.remove()">
														<span class="glyphicon glyphicon-trash"></span> 删除
													</button>
												</shiro:hasPermission>
													<button type="button" class="btn btn-default" ng-show="false"
														data-ng-disabled="!Model.dataMaster.readonly()"
														data-ng-click="Model.print()">
														<span class="glyphicon glyphicon-print"></span> 打印
													</button>
												<shiro:hasPermission name="${path}:export">
													<button type="button" class="btn btn-default"
														data-ng-disabled="!Model.dataMaster.readonly()"
														data-ng-click="Model.printExport()">
														<span class="glyphicon glyphicon-export"></span> 输出
													</button>
												</shiro:hasPermission>
											</div>
										</li>
									</ul>


									<ul class="pagination navbar-left buttonBar" ng-hide="type=='FLOW'">
										<li>
											<div class="btn-group" role="toolbar">
												<shiro:hasPermission name="${path}:query">
													<button type="button" class="btn btn-default"
														data-ng-disabled="!Model.dataMaster.readonly()"
														data-ng-click="Model.refresh()">
														<span class="glyphicon glyphicon-refresh"></span> 刷新
													</button>
												</shiro:hasPermission>
											
												<row-ination data="Model.dataMaster" template-url="js/_directives/rowInation_div.html" first-text="第一条" previous-text="上一条" next-text="下一条" last-text="最后一条" first-show="false" previous-show="true" next-show="true" last-show="false"></row-ination>
										  </div>
										</li>
									</ul>
									
									<ul class="pagination navbar-left buttonBar" data-ng-show="Model.dataMaster.getFlowType()==0 || Model.dataMaster.getFlowType()==1">

										<li>
											<div class="btn-group" role="toolbar">
												<shiro:hasPermission name="${path}:confirm">
												<button type="button" class="btn btn-success"
													title="提交后将不能编辑。"
													data-ng-show="!Model.dataMaster.getCurrentAudit() && !Model.dataMaster.getCurrentState()"
													data-ng-disabled="!Model.dataMaster.readonly()"
													data-ng-click="Model.triggerConfirmClick()">
													<span class="glyphicon glyphicon-lock"></span> 提交
												</button>
												</shiro:hasPermission>
												<shiro:hasPermission name="${path}:agreeIt">
												<button type="button" class="btn btn-info"
													data-ng-show="!Model.dataMaster.getCurrentStatus() && Model.dataMaster.getCurrentState() && !Model.dataMaster.getCurrentAudit() && Model.dataMaster.getFlowType()==1"
													data-ng-disabled="!Model.dataMaster.readonly()"
													data-ng-click="Model.triggerAgreeItClick()">
													<span class="glyphicon glyphicon-lock"></span> 审批
												</button>
												</shiro:hasPermission>
											</div>
										</li>
									</ul>
								
	<ul class="pagination navbar-left buttonBar" data-ng-show="Model.dataMaster.getFlowType()==2">
		<li>
			<div class="btn-group" role="toolbar">
				<shiro:hasPermission name="${path}:confirm">
				<button type="button" class="btn btn-primary " 
					data-ng-if="!Model.dataMaster.getCurrentAudit() && !Model.dataMaster.getCurrentState()"
					data-ng-disabled="!Model.dataMaster.readonly()"
					data-ng-click="$root.startClick(Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()]);">
					<span class="glyphicon glyphicon-play"></span> 启动流程
				</button>
				</shiro:hasPermission>
				<shiro:hasPermission name="${path}:active">
				<button type="button" class="btn btn-warning" title="终止流程后可以继续修改"
					data-ng-if="!Model.dataMaster.getCurrentAudit() && Model.dataMaster.getCurrentState()"
					data-ng-disabled="!Model.dataMaster.readonly()"
					data-ng-click="$root.flowClick({'action':'ABORT','parentID':Model.winParams.flowTaskID,'sData1':Model.winParams.fID,'sData2':Model.winParams.billType,'sData3':Model.winParams.billTypeName,'row':Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()]})">
					<span class="glyphicon glyphicon-stop"></span> 终止流程
				</button>
				</shiro:hasPermission>


				<shiro:hasPermission name="${path}:agreeIt">
				<button type="button" class="btn btn-default" title="转交他人办理或报上级批准"
					data-ng-if="!Model.dataMaster.getCurrentStatus() && Model.dataMaster.getCurrentState() && !Model.dataMaster.getCurrentAudit() && Model.dataMaster.getFlowType()==2"
					data-ng-disabled="!Model.dataMaster.readonly()"
					data-ng-click="$root.flowClick({'action':'FORWARD','parentID':Model.winParams.flowTaskID,'sData1':Model.winParams.fID,'sData2':Model.winParams.billType,'sData3':Model.winParams.billTypeName,'row':Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()]})">
					<span class="glyphicon glyphicon-arrow-right"></span> 转交
				</button>
				<button type="button" class="btn btn-default" title="退回到提交人"
					data-ng-if="!Model.dataMaster.getCurrentStatus() && Model.dataMaster.getCurrentState() && !Model.dataMaster.getCurrentAudit() && Model.dataMaster.getFlowType()==2"
					data-ng-disabled="!Model.dataMaster.readonly()"
					data-ng-click="$root.flowClick({'action':'BACKWARD','parentID':Model.winParams.flowTaskID,'sData1':Model.winParams.fID,'sData2':Model.winParams.billType,'sData3':Model.winParams.billTypeName,'row':Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()]})">
					<span class="glyphicon glyphicon-arrow-left"></span> 回退
				</button>
				<button type="button" class="btn btn-default" title="完成单据批准，流程结束"
					data-ng-if="!Model.dataMaster.getCurrentStatus() && Model.dataMaster.getCurrentState() && !Model.dataMaster.getCurrentAudit() && Model.dataMaster.getFlowType()==2"
					data-ng-disabled="!Model.dataMaster.readonly()"
					data-ng-click="$root.flowClick({'action':'FINISH','parentID':Model.winParams.flowTaskID,'sData1':Model.winParams.fID,'sData2':Model.winParams.billType,'sData3':Model.winParams.billTypeName,'row':Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()]})">
					<span class="glyphicon glyphicon-ok"></span> 完成
				</button>
				</shiro:hasPermission>
			
				
				<button type="button" class="btn btn-default"
					data-ng-disabled="!Model.dataMaster.readonly()"
					data-ng-click="$root.openFlowTaskTrack({'sData1':Model.dataMaster.getCurrentID()})">
					<span class="glyphicon glyphicon-list-alt"></span> 流程轨迹
				</button>
				
			</div>
		</li>
	</ul>

									<!-- 
									<ul class="pagination navbar-right buttonBar" style="padding-left: 5px;">
										<li class="dropdown" data-ng-show="Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].audit.value=='confirm'">
										  <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
										    <span class="glyphicon glyphicon-log-out"></span> 生成
										    <span class="caret"></span>
										  </button>
										  <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
										    <li><a href="#invXSFHModal" data-toggle="modal">销售发货单</a></li>
										    <li><a href="#recYSKDModal" data-toggle="modal">预收款单</a></li>
										  </ul>
										</li>
									</ul>
									 -->

									<ul class="pagination navbar-left buttonBar" ng-if="Model.dataMaster.getCurrentAudit()">
										<li>
											<div class="btn-group" role="toolbar">
												<shiro:hasPermission name="${path}:pushYSKD">
												<button type="button" class="btn btn-default" 
													ng-show="Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].paymentStatus.value!='paid'"
													ng-click="Model.pushYSKD($event)" title="生成预收款单">
													<i class="fa fa-jpy" aria-hidden="true"></i> 收款
												</button>
											        <button type="button" class="btn btn-default" 
										        	ng-show="Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].paymentStatus.value=='paid'"
										        	ng-disabled="true"><i class="fa fa-jpy" aria-hidden="true"></i> 已收款</button>
												</shiro:hasPermission>
												<shiro:hasPermission name="${path}:pushXSCK">
												<button type="button" class="btn btn-default" 
													ng-show="Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].pickItemIng.value+Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].pickItemAmount.value< Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].itemAmount.value"
													ng-click="Model.pushXSCK($event)" title="生成销售发货单">
													<i class="fa fa-university" aria-hidden="true"></i> 出库
												</button>
										        <button type="button" class="btn btn-default" 
										        	ng-show="Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].pickItemIng.value+Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].pickItemAmount.value>=Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].itemAmount.value"
										        	ng-disabled="true"><i class="fa fa-university" aria-hidden="true"></i> 已出库</button>
												</shiro:hasPermission>
												<button type="button" class="btn btn-default" 
													ng-show="Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].pickItemIng.value+Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].pickItemAmount.value< Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].itemAmount.value"
													data-toggle="modal" data-target="#invXSFHModal" title="填写物流运单号">
													<i class="fa fa-truck" aria-hidden="true"></i> 发货
												</button>
											
										  </div>
										</li>
									</ul>
												
									<ul class="pagination navbar-right buttonBar" >
										<li data-ng-show="Model.dataMaster.getFlowType()==0 || Model.dataMaster.getFlowType()==1">
												<shiro:hasPermission name="${path}:active">
												<button type="button" class="btn btn-default"
													title="撤销提交后可以编辑。"
													data-ng-show="!Model.dataMaster.getCurrentAudit() && Model.dataMaster.getCurrentState()"
													data-ng-disabled="!Model.dataMaster.readonly()"
													data-ng-click="Model.triggerActiveClick()">
													<span class="glyphicon glyphicon-retweet"></span> 撤销提交
												</button>
												</shiro:hasPermission>
												
												<shiro:hasPermission name="${path}:unAgree">
												<button type="button" class="btn btn-default"
													data-ng-show="!Model.dataMaster.getCurrentStatus() && Model.dataMaster.getCurrentState() && Model.dataMaster.getCurrentAudit()"
													data-ng-disabled="!Model.dataMaster.readonly()"
													data-ng-click="Model.triggerUnAgreeClick()">
													<span class="glyphicon glyphicon-retweet"></span> 撤销审批
												</button>
												</shiro:hasPermission>
										</li>
										<li>
											<div class="btn-group" role="toolbar">
												<shiro:hasPermission name="${path}:close">
												<button type="button" class="btn btn-default" title="关闭后，此单据在系统中将不参与任何业务活动。"
													data-ng-show="Model.dataMaster.getCurrentAudit() && !Model.dataMaster.getCurrentStatus()"
													data-ng-disabled="!Model.dataMaster.readonly()"
													data-ng-click="Model.triggerCloseClick()">
													<span class="glyphicon glyphicon-lock"></span> 关闭
												</button>
												</shiro:hasPermission>
												<shiro:hasPermission name="${path}:open">
												<button type="button" class="btn btn-default"
													data-ng-show="Model.dataMaster.getCurrentAudit() && Model.dataMaster.getCurrentStatus()"
													data-ng-disabled="!Model.dataMaster.readonly()"
													data-ng-click="Model.triggerOpenClick()">
													<span class="glyphicon glyphicon-retweet"></span> 打开
												</button>
												</shiro:hasPermission>
											</div>
										</li>
									</ul>
									

									
								</nav>
							</div>
						</div>
						
						<audit-status get-status="Model.dataMaster.getCurrentAudit()"></audit-status>
						
						<!-- 主表FORM -->
						<div class="row">
							<div class="col-sm-12">
						
								<uib-tabset> 
								<uib-tab>
								<uib-tab-heading>
									基本信息
									<span ng-if="Model.dataMaster.userdata.recordState=='edit'">*</span>
									<span hidden="hidden" ng-bind="Model.dataMaster.userdata.recordState"></span>
									<span hidden="hidden" ng-bind="Model.dataMaster.userdata.changed"></span>
								</uib-tab-heading>
								<br>

								<form class="form-horizontal"
									id="sale_saleOrder_single_form_base">

									<div class="row">
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">单号</label>
												<div class="col-sm-8">
													<input type="text" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].orderNo.value"
														placeHolder="自动编码" name="orderNo" disabled />
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">整单折扣</label>
												<div class="col-sm-8">
													<input type="number" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].discountAmount.value"
														name="discountAmount" disabled/>
												</div>
											</div>
										</div>
										<div class="col-sm-3">

											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">日期</label>
												<div class="col-sm-8">
														<input type="text" class="form-control" simple-datepicker
															orientation="bottom auto"
															data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].orderDate.value"
															name="orderDate"
															data-ng-disabled="Model.dataMaster.readonly();" />
															
												</div>
											</div>

										</div>
										<div class="col-sm-3" ng-hide="true">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">审批状态</label>
												<div class="col-sm-8">
													<div data-ng-switch="Model.dataMaster.getCurrentAudit()">
														<img data-ng-switch-when="true"
															src="images/confirm.png" height="30px"></img> <img
															data-ng-switch-when="false"
															src="images/active.png" height="30px"></img>
													</div>
												</div>
											</div>
										</div>
										<div class="col-sm-3" ng-hide="false">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">审签方式</label>
												<div class="col-sm-8">
													<flow-type force-disabled="false" target-data="Model.dataMaster" target-value="flowType" row-index="Model.dataMaster.getCurrentIndex()"></flow-type>
												</div>
											</div>
										</div>
									</div>
									<div class="row">
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">工厂</label>
												<div class="col-sm-8">
													<div class="input-group">
														<input type="text" class="form-control" data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].factoryNo.value" disabled required/> 
														<span class="input-group-btn">
															<button class="btn btn-default btn-sm" data-ng-disabled="Model.dataMaster.readonly();" data-ng-click="Model.triggerFactoryNoClick()">
																<span class="glyphicon " data-ng-class="{'glyphicon-th-list':(Model.dataMaster.rows[Model.dataMaster.currentIndex].factoryNo.value==null || Model.dataMaster.rows[Model.dataMaster.currentIndex].factoryNo.value==''),'glyphicon-remove':!(Model.dataMaster.rows[Model.dataMaster.currentIndex].factoryNo.value==null || Model.dataMaster.rows[Model.dataMaster.currentIndex].factoryNo.value=='')}"
																	aria-hidden="true"></span>
															</button>
														</span>
													</div>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">名称</label>
												<div class="col-sm-8">
													<input type="text" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].factoryName.value"
														name="factoryName" disabled/>
												</div>
											</div>
										</div>
										
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">经办人</label>
												<div class="col-sm-8">
													<div class="input-group">
														<input type="text" class="form-control"
															data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].employeeName.value"
															data-ng-readonly="true" /> <span
															class="input-group-btn">
															<button class="btn btn-default btn-sm"
																data-ng-disabled="Model.dataMaster.readonly();"
																data-ng-click="Model.triggerEmployeeNoClick()">
																<span class="glyphicon "
																	data-ng-class="{'glyphicon-th-list':(Model.dataMaster.rows[Model.dataMaster.currentIndex].employeeNo.value==null || Model.dataMaster.rows[Model.dataMaster.currentIndex].employeeNo.value==''),'glyphicon-remove':!(Model.dataMaster.rows[Model.dataMaster.currentIndex].employeeNo.value==null || Model.dataMaster.rows[Model.dataMaster.currentIndex].employeeNo.value=='')}"
																	aria-hidden="true"></span>
															</button>
														</span>
													</div>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">单据状态</label>
												<div class="col-sm-8">
													<input type="tel" class="form-control" readonly="readonly"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].orderStatusLabel.value"/>
												</div>
											</div>
										</div>
									</div>
									<div class="row">

										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">客户代码</label>
												<div class="col-sm-8">
													<div class="input-group">
														<input type="text" class="form-control" 
															data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].customerNo.value"
															name="customerNo"
															disabled required/> <span
															class="input-group-btn">
															<button class="btn btn-default btn-sm"
																data-ng-disabled="Model.dataMaster.readonly();"
																data-ng-click="Model.triggerProviderNoClick()">
																<span class="glyphicon "
																	data-ng-class="{'glyphicon-th-list':(Model.dataMaster.rows[Model.dataMaster.currentIndex].customerNo.value==null || Model.dataMaster.rows[Model.dataMaster.currentIndex].customerNo.value==''),'glyphicon-remove':!(Model.dataMaster.rows[Model.dataMaster.currentIndex].customerNo.value==null || Model.dataMaster.rows[Model.dataMaster.currentIndex].customerNo.value=='')}"
																	aria-hidden="true"></span>
															</button>
														</span>
													</div>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">简称</label>
												<div class="col-sm-8">
													<input type="text" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].shortName.value"
														name="shortName" disabled/>
												</div>
											</div>
										</div>
										<div class="col-sm-6">
											<div class="form-group form-group-sm">
												<label class="col-sm-2 control-label">客户全称</label>
												<div class="col-sm-10">
													<input type="text" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].customerName.value"
														name="customerName"
														data-ng-readonly="true" /> 
												</div>
											</div>
										</div>
									</div>
								</form>
								</uib-tab> 
								<uib-tab heading="发票信息"> <br>

								<form class="form-horizontal"
									id="sale_saleOrder_single_form_invoice">

									<div class="row">
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">发票类型</label>
												<div class="col-sm-8">
												<invoice-category 
													target-data="Model.dataMaster"
													target-label="invoiceCategoryLabel"
													target-value="invoiceCategory"
													row-index="Model.dataMaster.getCurrentIndex()"
													vertical="dropdown"
													horizon="right"
													value-show="false">
												</invoice-category>
												
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">税种</label>
												<div class="col-sm-8">
												<tax-type 
													target-data="Model.dataMaster"
													target-label="taxTypeLabel"
													target-value="taxType"
													row-index="Model.dataMaster.getCurrentIndex()"
													vertical="dropdown"
													horizon="right"
													value-show="false">
												</tax-type>
												</div>
											</div>
										</div>
										<div class="col-sm-3">

											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">税率</label>
												<div class="col-sm-8">
													<input type="number" class="form-control" 
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].taxRate.value"
														name="taxRate"
														data-ng-disabled="Model.dataMaster.readonly();" />
												</div>
											</div>

										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">结算方式</label>
												<div class="col-sm-8">
													<settle-category 
														target-data="Model.dataMaster"
														target-label="settleCategoryLabel"
														target-value="settleCategory"
														row-index="Model.dataMaster.getCurrentIndex()"
														vertical="dropdown"
														horizon="right"
														value-show="false">
													</settle-category>
												</div>
											</div>
										</div>
									</div>
									
									<div class="row">
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">定金比率</label>
												<div class="col-sm-8">
													<input type="number" ng-show="!Model.dataMaster.readonly()" class="form-control" name="depositRate"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].depositRate.value"
														data-ng-disabled="Model.dataMaster.readonly();" />
													
													<input type="text" ng-show="Model.dataMaster.readonly()" class="form-control" value="{{Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].depositRate.value | PercentValue}}" readonly="readonly">
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">支付状态</label>
												<div class="col-sm-8">
													<input type="text" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].paymentStatusLabel.value"
														name="paymentStatusLabel" readonly="readonly" />
												</div>
											</div>
										</div>
										<div class="col-sm-6">
											<div class="form-group form-group-sm">
												<label class="col-sm-2 control-label">付款条件</label>
												<div class="col-sm-10">
														<input type="text" class="form-control" name="paymentTermLabel"
															data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].paymentTermLabel.value"
															data-ng-disabled="Model.dataMaster.readonly();" />
												</div>
											</div>
										</div>
									</div>
									<div class="row">
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">联系人</label>
												<div class="col-sm-8">
													<input type="text" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].contacts.value"
														name="contacts" data-ng-disabled="Model.dataMaster.readonly();" readonly="readonly" />
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">移动电话</label>
												<div class="col-sm-8">
													<input type="tel" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].mobilePhone.value"
														name="mobilePhone" data-ng-disabled="Model.dataMaster.readonly();" readonly="readonly" />
												</div>
											</div>
										</div>
										<div class="col-sm-6">
											<div class="form-group form-group-sm">
												<label class="col-sm-2 control-label">办公地址</label>
												<div class="col-sm-10">
													<input type="text" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].fAddressDetail.value"
														name="fAddressDetail" data-ng-disabled="Model.dataMaster.readonly();" readonly="readonly" />
												</div>
											</div>
										</div>
									</div>
								</form>
								</uib-tab> 
								<uib-tab heading="会员/优惠"> <br>

								<form class="form-horizontal" id="sale_saleOrder_single_form_freight">
									<div class="row">
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">商品数量</label>
												<div class="col-sm-8">
													<input type="number" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].itemAmount.value"
														data-ng-disabled="true"/>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">未税金额</label>
												<div class="col-sm-8">
													<input type="number" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].orderAmountOld.value"
														data-ng-disabled="true"/>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">税额</label>
												<div class="col-sm-8">
													<input type="number" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].orderAmountTax.value"
														data-ng-disabled="true"/>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">价税合计</label>
												<div class="col-sm-8">
													<input type="number" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].orderAmountTotal.value"
														data-ng-disabled="true"/>
												</div>
											</div>
										</div>
									</div>

									<div class="row">
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">是否会员</label>
												<div class="col-sm-8">
													<input type="checkbox" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].isMember.value"
														data-ng-true-value=1 data-ng-false-value=0 
														ng-disabled="true">
												</div>
											</div>
										</div>
									</div>

									<div class="row">
										<div class="col-sm-3">
										</div>
										<div class="col-sm-3">
										</div>
										<div class="col-sm-3">
										</div>
										<div class="col-sm-3">
											<button class="btn btn-primary btn-sm pull-right" ng-disabled="!Model.dataMaster.readonly()" ng-click="Model.triggerDiscountAmount()"><span class="glyphicon glyphicon-plus"></span> 整单折扣</button>
										</div>
									</div>
										</form>
								</uib-tab> 
								<uib-tab heading="地址信息"> <br>

								<form class="form-horizontal"
									id="sale_invXSCK_single_form_address">

									<div class="row">
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">送货/自提</label>
												<div class="col-sm-8">
												<input type="checkbox" class="form-control" bootstrap-switch  
													data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].doorBuster.value"
													off-color="primary" on-color="danger" on-text="客户自提" off-text="送货上门"
													ng-true-value="'Y'" ng-false-value="'N'" size="small" can-input="Model.dataMaster.readonly();"/>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label ng-if="Model.dataMaster.rows[Model.dataMaster.currentIndex].doorBuster.value!='Y'" class="col-sm-4 control-label">地址</label>
												<label ng-if="Model.dataMaster.rows[Model.dataMaster.currentIndex].doorBuster.value=='Y'" class="col-sm-4 control-label">自提点</label>
												<div class="col-sm-8">
													<div class="input-group">
													<input type="text" class="form-control" 
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].fAddressName.value"/> 
														<span class="input-group-btn">
															<button class="btn btn-default btn-sm" data-ng-disabled="Model.dataMaster.readonly();" data-ng-click="Model.triggerFileAddressClick()">
																<span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
															</button>
														</span>
													</div>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">联系人</label>
												<div class="col-sm-8">
													<input type="text" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].contacts.value"
														name="contacts" data-ng-disabled="Model.dataMaster.readonly();"/>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">移动电话</label>
												<div class="col-sm-8">
													<input type="tel" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].mobilePhone.value"
														name="mobilePhone" data-ng-disabled="Model.dataMaster.readonly();"/>
												</div>
											</div>
										</div>
									</div>
									<div class="row">
										<div class="col-sm-6">
											<div class="form-group form-group-sm">
												<label class="col-sm-2 control-label">所在地区</label>
												<div class="col-sm-10">
													<div class="input-group">
														<input type="text" class="form-control" data-ng-readonly="true" value="{{Model.dataMaster.rows[Model.dataMaster.currentIndex].fProvince.value}}{{Model.dataMaster.rows[Model.dataMaster.currentIndex].fCity.value}}{{Model.dataMaster.rows[Model.dataMaster.currentIndex].fZone.value}}"/>
														<span class="input-group-btn">
															<button class="btn btn-default btn-sm" data-ng-disabled="Model.dataMaster.readonly();" data-ng-click="Model.triggerRegionCodeClick()">
																<span class="glyphicon " data-ng-class="{'glyphicon-th-list':(Model.dataMaster.rows[Model.dataMaster.currentIndex].fAddress.value==null || Model.dataMaster.rows[Model.dataMaster.currentIndex].fAddress.value==''),'glyphicon-remove':!(Model.dataMaster.rows[Model.dataMaster.currentIndex].fAddress.value==null || Model.dataMaster.rows[Model.dataMaster.currentIndex].fAddress.value=='')}"
																	aria-hidden="true"></span>
															</button>
														</span>
													</div>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">固定电话</label>
												<div class="col-sm-8">
													<input type="tel" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].fPhone.value"
														name="fPhone" data-ng-disabled="Model.dataMaster.readonly();"/>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">需要物流</label>
												<div class="col-sm-8">
													<input type="checkbox" class="form-control" ng-true-value=1 ng-false-value=0
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].isNeedLogistics.value"
														name="isNeedLogistics" data-ng-disabled="Model.dataMaster.readonly();"/>
												</div>
											</div>
										</div>
									</div>
									<div class="row">
										<div class="col-sm-6">
											<div class="form-group form-group-sm">
												<label class="col-sm-2 control-label">详细地址</label>
												<div class="col-sm-10">
													<input type="text" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].fAddressDetail.value"
														name="fAddressDetail" data-ng-disabled="Model.dataMaster.readonly();"/>
												</div>
											</div>
										</div>
										<div class="col-sm-3">
											<div class="form-group form-group-sm">
												<label class="col-sm-4 control-label">运费</label>
												<div class="col-sm-8">
													<input type="number" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].freightAmount.value"
														name="freightAmount" data-ng-disabled="Model.dataMaster.readonly();"/>
												</div>
											</div>
										</div>
										
									</div>
										</form>
								</uib-tab> 
								<uib-tab heading="附件"> 
									<attachments permission="public"
										data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].attachments.value"
										cantedit="Model.dataMaster.readonly()">
									</attachments>	
								</uib-tab> 
								<uib-tab heading="备注"> <br>

								<form class="form-horizontal"
									id="sale_saleOrder_single_form_comments">

									<div class="row">
										<div class="col-sm-12">

											<div class="form-group">
												<label class="col-sm-1 control-label">备注</label>
												<div class="col-sm-11">
													<textarea rows="5" class="form-control"
														data-ng-model="Model.dataMaster.rows[Model.dataMaster.currentIndex].comments.value"
														data-ng-readonly="Model.dataMaster.readonly();">
													</textarea>
												</div>
											</div>

										</div>
									</div>
								</form>
								</uib-tab> 
								<uib-tab heading="制单"> <br>
									<cet-info target-data="Model.dataMaster"></cet-info>
								</uib-tab> 
								</uib-tabset>


							</div>
						</div>
						<!-- 子表按钮菜单 -->
						<div class="row">
							<div class="col-sm-12">

								<nav class="nav">
									<ul class="pagination navbar-left buttonBar">
										<li>
											<div class="btn-group" role="toolbar">
												<button type="button" class="btn btn-default "
													data-ng-disabled="Model.dataMaster.readonly()"
													data-ng-click="Model.addrow()">
													<span class="glyphicon glyphicon-plus"></span> 增加
												</button>
												<button type="button" class="btn btn-default"
													data-ng-disabled="Model.dataMaster.readonly() || Model.dataDetail.currentIndex==null"
													data-ng-click="Model.delrow()">
													<span class="glyphicon glyphicon-minus"></span> 删除
												</button>
												<button type="button" class="btn btn-default "
													data-ng-disabled="Model.dataMaster.readonly()"
													data-ng-click="Model.addrows()">
													<span class="glyphicon glyphicon-plus-sign"></span> 物料档案...
												</button>

											</div>
										</li>
									</ul>
									<ul class="pagination navbar-right buttonBar" ng-if="false">
										<li>
											<div class="badge">
												<span><font size="2">商品金额：￥{{Model.dataMaster.rows[Model.dataMaster.currentIndex].orderAmountTotal.value}}-折扣金额：￥{{Model.dataMaster.rows[Model.dataMaster.currentIndex].discountAmount.value}}+运费：￥{{Model.dataMaster.rows[Model.dataMaster.currentIndex].freightAmount.value}}+其他费用：￥{{Model.dataMaster.rows[Model.dataMaster.currentIndex].apportionAmount.value}}=总计：￥{{Model.dataMaster.rows[Model.dataMaster.currentIndex].totalAmount.value}}</font></span>
											</div>
										</li>
									</ul>
								</nav>

							</div>
						</div>
						
						<!-- 子表 -->
						<div class="row">
							<div class="col-sm-12">

							<div class="table-responsive">
								<table class="table table-hover table-condensed"
									data-readonly={{Model.dataDetail.readonly()}}
									style="cellpadding: 0px; cellspacing: 0px;">
									<thead>
										<tr>
											<th colspan="99"  style="padding:0px;">
											</th>
										</tr>

										<tr ng-class="{'success':Model.dataDetail.readonly()==false}">

											<th>
												<span ng-if="Model.dataDetail.userdata.changed==0">#</span>
												<span ng-if="Model.dataDetail.userdata.changed>0">*</span>
											</th>
											<th hidden="hidden">recordState</th>
											<th hidden="hidden">changed</th>
											<th hidden="hidden">fID</th>

											<th hidden="hidden">操作状态</th>
											<th hidden="hidden">子系统</th>
											<th hidden="hidden">单据类型</th>
											<th hidden="hidden">单据类型</th>
											<th hidden="hidden">日期</th>
											<th hidden="hidden">audit</th>
											<th hidden="hidden">fMasterID</th>

											<th>物料编码</th>
											<th>物料描述</th>
											<th>单位</th>
											<th>数量</th>
											<th>单价</th>
											<th>折扣率</th>
											<th ng-show="Model.dataMaster.rows[Model.dataMaster.currentIndex].discountAmount.value!=0">整单折扣</th>
											<th>金额</th>
											<th>未税金额</th>
											<th>税额</th>
											<th>价税合计</th>
											<th>预计发货</th>
											<th hidden="hidden">storageNo</th>
											<th hidden="hidden">storageName</th>
											<th hidden="hidden">库存地</th>
											<th hidden="hidden">备注</th>
											<th hidden="hidden">公司id</th>
											<th hidden="hidden">公司</th>
										</tr>
									</thead>
									<tbody>
										<tr data-ng-class="{'active':Model.dataDetail.currentIndex==Model.dataDetail.rows.indexOf(row),'warning':row.userdata.changed>0}"
											data-ng-click="Model.dataDetail.onRowClick(row,$event)"
											data-ng-repeat="row in Model.dataDetail.rows">

											<td style="width: 20px;">
												<span data-ng-show="Model.dataDetail.currentIndex==Model.dataDetail.rows.indexOf(row)"
												class="glyphicon glyphicon-hand-right" aria-hidden="true"></span>
												<span data-ng-show="Model.dataDetail.currentIndex!=Model.dataDetail.rows.indexOf(row)">{{Model.dataDetail.rows.indexOf(row)+1}}</span>
											</td>
											
											<td style="width: 50px;" hidden="hidden"><span data-ng-bind="row.userdata.recordState"></span></td>
											<td style="width: 50px;" hidden="hidden"><span data-ng-bind="row.userdata.changed"></span></td>
											
											<td style="width: 200px;" hidden="hidden">{{row.fID.value}}<span
												data-ng-bind="row.enterpriseNo.value"></span></td>

											<td style="width: 100px;" hidden="hidden"><span
												data-ng-bind="row.state.value"></span></td>
											<td style="width: 100px;" hidden="hidden"><span
												data-ng-bind="row.systemCode.value"></span></td>
											<td style="width: 100px;" hidden="hidden"><span
												data-ng-bind="row.billType.value"></span></td>
											<td style="width: 100px;" hidden="hidden"><span
												data-ng-bind="row.billTypeName.value"></span></td>
											<td style="width: 500px;" hidden="hidden" td-input="date"
												data-orientation="bottom auto"
												data-ng-model="row.orderDate.value"><span
												data-ng-bind="row.orderDate.value"></span></td>
											<td style="width: 100px;" hidden="hidden"><span
												data-ng-bind="row.audit.value"></span></td>
											<td style="width: 100px;" hidden="hidden"><span
												data-ng-bind="row.fMasterID.value"></span></td>

											<td style="width: 100px;padding:0px;">
											
    <input type="text" ng-model="row.itemNo.value" placeholder="物料编码" uib-typeahead="item.itemNo as item.itemNo+'|'+item.itemDescribe for item in filterItemList($viewValue)" typeahead-loading="loadingLocations" typeahead-no-results="noResults" typeahead-on-select="filterItemOnSelect($item, $model, $label, $event)" class="form-control" ng-disabled="Model.dataDetail.readonly()">
    <i ng-show="loadingLocations" class="glyphicon glyphicon-refresh"></i>
    <div ng-show="noResults">
      <i class="glyphicon glyphicon-remove"></i> 无结果
    </div>

    
											</td>
												
											<td style="width: 300px;"  ng-if="row.lv.value==0" td-input="outputbtn" iptclick="Model.grid_itemNoButtonClick()" data-ng-model="row.itemDescribe.value">
												<span data-ng-bind="row.itemDescribe.value"></span>
											</td>
											<td style="width: 300px;text-indent:2em;" ng-if="row.lv.value==1" td-input="outputbtn" iptclick="Model.grid_itemNoButtonClick()" data-ng-model="row.itemDescribe.value">
												<span data-ng-bind="row.itemDescribe.value"></span>
											</td>
											<td style="width: 50px;" td-input="ro"
												data-ng-model="row.unitName.value"><span
												data-ng-bind="row.unitName.value"></span></td>
											<td style="width: 100px;" td-input="number"
												data-ng-model="row.itemAmount.value"><span
												data-ng-bind="row.itemAmount.value"></span></td>
											<td style="width: 100px;" td-input="number"	data-ng-model="row.itemPrice.value">
												<span data-ng-bind="row.itemPrice.value"></span>
											</td>
											<td style="width: 100px;" td-input="number"
												data-ng-model="row.discountRate.value"><span
												data-ng-bind="row.discountRate.value*100+'%'"></span></td>
											<td style="width: 100px;" td-input="ro"
											 	ng-show="Model.dataMaster.rows[Model.dataMaster.currentIndex].discountAmount.value!=0"
												data-ng-model="row.discountAmount.value"><span
												data-ng-bind="row.discountAmount.value"></span></td>
											<td style="width: 100px;" td-input="ro"
												data-ng-model="row.orderAmount.value"><span
												data-ng-bind="row.orderAmount.value"></span></td>
											<td style="width: 100px;" td-input="ro"
												data-ng-model="row.orderAmountOld.value"><span
												data-ng-bind="row.orderAmountOld.value"></span></td>
											<td style="width: 100px;" td-input="ro"
												data-ng-model="row.orderAmountTax.value"><span
												data-ng-bind="row.orderAmountTax.value"></span></td>
											<td style="width: 100px;" td-input="ro"
												data-ng-model="row.orderAmountTotal.value"><span
												data-ng-bind="row.orderAmountTotal.value"></span></td>
											<td style="width: 100px;" td-input="date" data-ng-model="row.requirementDate.value">
												<span data-ng-bind="row.requirementDate.value"></span>
											</td>
											<td style="width: 200px;" hidden="hidden"
												data-ng-model="row.storageNo.value"><span
												data-ng-bind="row.storageNo.value"></span>
											</td>
											<td style="width: 200px;" hidden="hidden"
												data-ng-model="row.storageName.value"><span
												data-ng-bind="row.storageName.value"></span>
											</td>
											<td style="width: 300px;" td-input="inputbtn" hidden="hidden"
												iptclick="Model.grid_floorNoButtonClick()"
												data-ng-model="row.floorNo.value"><span
												data-ng-bind="row.floorNo.value"></span>
											</td>
											<td style="width: 200px;" td-input="text" hidden="hidden"
												data-ng-model="row.comments.value"><span
												data-ng-bind="row.comments.value"></span></td>
											<td style="width: 100px;" hidden="hidden"><span
												data-ng-bind="row.enterpriseNo.value"></span></td>
											<td style="width: 200px;" hidden="hidden"><span
												data-ng-bind="row.enterpriseName.value"></span></td>

										</tr>
										

									</tbody>
									<tfoot>
										<tr ng-class="{'success':Model.dataDetail.readonly()==false}">

											<th></th>
											<th hidden="hidden"><span data-ng-bind="Model.dataDetail.userdata.recordState"></span></th>
											<th hidden="hidden"><span data-ng-bind="Model.dataDetail.userdata.changed"></span></th>
											<th hidden="hidden">fID</th>

											<th hidden="hidden">操作状态</th>
											<th hidden="hidden">子系统</th>
											<th hidden="hidden">单据类型</th>
											<th hidden="hidden">单据类型</th>
											<th hidden="hidden">日期</th>
											<th hidden="hidden">audit</th>
											<th hidden="hidden">fMasterID</th>

											<th>物料编码</th>
											<th>合计：{{Model.dataMaster.rows[Model.dataMaster.currentIndex].detailsCount.value}}笔</th>
											<th></th>
											<th><span data-ng-bind="Model.dataMaster.rows[Model.dataMaster.currentIndex].itemAmount.value"></span></th>
											<th></th>
											<th></th>
											<th ng-show="Model.dataMaster.rows[Model.dataMaster.currentIndex].discountAmount.value!=0">
												<span data-ng-bind="Model.dataMaster.rows[Model.dataMaster.currentIndex].discountAmount.value"></span>
											</th>
											<th><span data-ng-bind="Model.dataMaster.rows[Model.dataMaster.currentIndex].orderAmount.value"></span></th>
											<th><span data-ng-bind="Model.dataMaster.rows[Model.dataMaster.currentIndex].orderAmountOld.value"></span></th>
											<th><span data-ng-bind="Model.dataMaster.rows[Model.dataMaster.currentIndex].orderAmountTax.value"></span></th>
											<th><span data-ng-bind="Model.dataMaster.rows[Model.dataMaster.currentIndex].orderAmountTotal.value"></span></th>
											<th></th>
											<th hidden="hidden">storageNo</th>
											<th hidden="hidden">storageName</th>
											<th hidden="hidden">库存地</th>
											<th hidden="hidden">备注</th>
											<th hidden="hidden">公司id</th>
											<th hidden="hidden">公司</th>
										</tr>
										<tr>
											<th colspan="99"  style="padding:0px;">
											</th>
										</tr>
									
									</tfoot>

								</table>
								
							</div>


							</div>
							
							
							
						</div>

						<div class="row">
							<div class="col-sm-12">

								<bottom-tab source-data="Model.dataDetail" 
									item-click="Model.grid_itemNoButtonClick()" 
									to-click="Model.grid_floorNoButtonClick()">
								</bottom-tab>							
							</div>
						</div>



					</div>

				</div>






			</div>
		</div>
		
		

<!-- Modal -->
<div class="modal fade" id="invXSFHModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header alert bg-warning">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">发货</h4>
      </div>
      <div class="modal-body">
<form class="form-horizontal">
  <div class="form-group">
    <label class="col-sm-2 control-label">状态</label>
    <div class="col-sm-10">
      <p class="form-control" ng-bind="Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].orderStatusLabel.value"></p>
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">发货品种</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" 
	      data-ng-model="Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].detailsCount.value" readonly="readonly">
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">总数量</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" 
	      data-ng-model="Model.dataMaster.rows[Model.dataMaster.getCurrentIndex()].itemAmount.value" readonly="readonly">
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">收货人</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" 
	      data-ng-model="Model.dataWaybill.rows[Model.dataWaybill.getCurrentIndex()].tLinkman.value" readonly="readonly">
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">联系电话</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" 
	      data-ng-model="Model.dataWaybill.rows[Model.dataWaybill.getCurrentIndex()].tPhone.value" readonly="readonly">
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">收货地址</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" 
	      value="{{Model.dataWaybill.rows[Model.dataWaybill.getCurrentIndex()].tProvince.value}}{{Model.dataWaybill.rows[Model.dataWaybill.getCurrentIndex()].tCity.value}}{{Model.dataWaybill.rows[Model.dataWaybill.getCurrentIndex()].tZone.value}}{{Model.dataWaybill.rows[Model.dataWaybill.getCurrentIndex()].tAddressDetail.value}}" readonly="readonly">
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">物流公司*</label>
    <div class="col-sm-10">
		<div class="input-group">
      		<input type="text" class="form-control" data-ng-model="shortName" readonly="readonly" required />
			<span class="input-group-btn">
				<button class="btn btn-default btn-warning" data-ng-click="Model.triggerShipperNoClick()">
					<span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
				</button>
			</span>
		</div>
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">货运单号*</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" data-ng-model="waybillNumber" required />
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">备注</label>
    <div class="col-sm-10">
		<textarea rows="5" class="form-control" data-ng-model="comments"></textarea>
    </div>
  </div>
</form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary" ng-click="Model.deliveryGoods($event)">确认发货</button>
        <button type="button" class="btn btn-default" ng-disabled="true">已发货</button>
      </div>
    </div>
  </div>
</div>



	</div>


</body>

</html>

